package com.googlecode.pwlodars.piteststat.database;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import com.googlecode.pwlodars.piteststat.content.PitestSingleResult;

public class PitestrSingleResultMapper implements RowMapper<PitestSingleResult>{

	public PitestSingleResult mapRow(ResultSet rs, int rowNum) throws SQLException {
		   int id = rs.getInt("id");
		   String className= rs.getString("className");
		   int mutationCoverage= rs.getInt("mutationCoverage");
		   Date runDate=rs.getDate("runDate");
		   
		   
		PitestSingleResult pitestSingleResult = PitestSingleResult.withClassNameOnly(className, mutationCoverage);
		pitestSingleResult.setRunDate(runDate);
		pitestSingleResult.setId(id);
		return pitestSingleResult;
	}

}
